package hamed;

import java.util.*;
public class PhrackTable
{
  private String title ;
  private Collection linkName;
  private Collection linkRef;
  
  public PhrackTable(){
    linkName=new Vector();
    linkRef=new Vector();
  }
  public void setTitle(String r){title=r;}
  public void addRrow(String name,String link){
    linkName.add(name);
    linkRef.add(link);
  }
  public String getOut(){
     String output=
    "<TABLE cellSpacing=0 cellPadding=1 width=184 bgColor=#0000a8 border=0>"+
     "<TBODY><TR>"+
      "<TD width=\"182\">"+
        "<TABLE cellSpacing=0 cellPadding=4 width=\"100%\" border=0>"+
            "<TBODY>"+
              "<TR bgColor=#000066>"+
                  "<TD><FONT face=Lucida,Verdana,Helvetica,Arial><B>"+
                     title+                                           
                  "</B></FONT></TD>"+
               "</TR>";

     Iterator nameIter=linkName.iterator();
     Iterator linkIter=linkRef.iterator();
     while (nameIter.hasNext()){
         String name=(String)nameIter.next();
         String ref=(String)linkIter.next();
             output+="<TR bgColor=#000044>"+                                        
                      "<TD><FONT face=Lucida,Verdana,Helvetica,Arial><SMALL>"+
                                          "<A href=\""+ref+"\">"
                                             +name+
                                          "</A><BR>"+
                                          "</SMALL></FONT></TD></TR>";
                                          
     }
     output+="</TBODY></TABLE></TD></TR></TBODY></TABLE>";
     return output;
  }
}
